

let tbody=document.querySelector('tbody');

axios.get('/goods').then(res=>{
    render(res.data)
})
function render(arr){
    tbody.innerHTML=arr.map(item=>{
        return `
            <tr>
                <td><input type="checkbox"></td>
                <td>
                    <img src="${item.img}">${item.name}
                </td>
                <td>${item.price}</td>
                <td>
                    <span>+</span>
                    <span>1</span>
                    <span>-</span>
                </td>
                <td>${item.count*item.price}</td>
                <td>
                    <span>删除</span>
                    <span>移入关注</span>
                </td>
            </tr>
        `
    }).join('')
}